<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 应用配置
 */
namespace app\allwin\validate;
use think\Validate;

class Config extends Validate{

    protected $rule = [
        'service_telephone'       => 'require',
        'default_charges'         => 'require|number|between: 0,100',
        'cash_charges'            => 'require|number|between: 0,100',
        'workers_rebate'          => 'require|number|between: 0,10',
        'agent_rebate'            => 'require|number|between: 0,10',
        'store_rebate'            => 'require|number|between: 0,20',
        'company_rebate'          => 'require|number|between: 0,20',
        'is_psp'                  => 'require|number|between:0,1',
        'is_wechat_profitsharing' => 'require|number|between: 0,1',
        'is_wechat_touser'        => 'require|number|between: 0,1',
        'is_wechat_redpacket'     => 'require|number|between: 0,1',
        'admin_uid'               => 'require|number',
        'workers_on_amount'       => 'require',
        'workers_on_store'        => 'require',
        'search_tip'              => 'require',
        'index_more'              => 'require',
        'index_shop_title'        => 'require',
        'shop_share_text'         => 'require',
        'shop_share_img'          => 'require',
        'user_card'               => 'require',
    ];

    protected $message = [
        'service_telephone'       => '客服电话必须填写',
        'default_charges'         => '交易费率必须填写,(0-100)之间',
        'cash_charges'            => '提现手续费必须填写,(0-100)之间',
        'workers_rebate'          => '合伙人奖励比例必须填写,(0-10)之间',
        'agent_rebate'            => '社群主奖励比例必须填写,(0-10)之间',
        'store_rebate'            => '商家奖励比例必须填写,(0-20)之间',
        'company_rebate'          => '分公司奖励比例必须填写,(0-20)之间',
        'is_psp'                  => '结算模式必须选择',
        'is_wechat_profitsharing' => '微信分账功能必须选项',
        'is_wechat_touser'        => '付款到零钱权限必须选择',
        'is_wechat_redpacket'     => '红包权限必须选择',
        'workers_on_amount'       => '合伙人费用必须填写',
        'workers_on_store'        => '合伙人开通好店费用必须填写',
        'workers_discount'        => '合伙人开通好店优惠必须填写',
        'search_tip'              => '搜索提醒必须填写',
        'index_more'              => '更多提醒必须填写',
        'index_shop_title'        => '首页商品标题必须填写',
        'shop_share_text'         => '经纪人内容必须填写',
        'shop_share_img'          => '经纪人图片必须填写',
        'user_card'               => '用户卡片内容必须填写',
    ];

    protected $scene = [
        'save' => ['workers_on_amount','workers_on_store','workers_discount','service_telephone','default_charges','cash_charges','agent_rebate','store_rebate','workers_rebate','company_rebate','is_psp','is_wechat_profitsharing','is_wechat_touser','is_wechat_redpacket'],
        'article' => ['search_tip','index_more','index_stores_tips','shop_share_text','shop_share_img','user_card'],
    ];
}